package coder.nav.model.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

/**
 * 饼状图
 * @author Bosen 2024/10/16 16:30
 */
@Data
public class NavChartPieVO {

    private List<Map<String, String>> data;

    public NavChartPieVO(Map<String, BigDecimal> data) {
        this.data = new ArrayList<>();
        data.forEach((key, value) -> {
            Map<String, String> map = new TreeMap<>();
            map.put("name", key);
            map.put("value", value.toString());
            this.data.add(map);
        });
    }

}
